require('babel-register')(require('../../babel/babel.base'))

const argv = require('yargs').argv
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const devConfig = require('./webpack-client').devConfig
const prodConfig = require('./webpack-client').prodConfig
const serverConfig = require('./webpack-server')

let config = {}
if (argv.opt == "server") {
    config = serverConfig
} else if (argv.opt == "client") {
    config = prodConfig
}
if (argv.ana == "true") {
    config.plugins.push(
        new BundleAnalyzerPlugin({
            analyzerHost: '0.0.0.0'
        })
    )
}

module.exports = config

